<!--{__NOLAYOUT__}-->
<html><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <title>赋能宝爸宝妈全国社群运营团队试用期合作协议</title>
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/css/queren.css" />
    <link rel="stylesheet" href="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/css/generate.css" />
    <script type="text/javascript" src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/layer_mobile/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/css/layer.css" />
    <script src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/jquery.1.9.1.js"></script>
    <script type="text/javascript" src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/rem.js"></script>
    <script type="text/javascript" src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/address_select/mobileSelect.js"></script>
    <link rel="stylesheet" type="text/css" href="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/address_select/mobileSelect.css" />
</head>
<body class="body_tj">
<div id="tbh5v0">
    <div class="addressmone">
        <div class="example">
          信息填写完成后视为协议签定<a target="_blank" href="https://tmall.fc62.com/funeng.pdf">点击查看协议范本</a>
        </div>
        <div style="width: 100%;height: 0.2rem;background-color: #f5f5f5;"></div>
        <ul>
            <li>
                <span>乙方姓名 <i>*</i></span>
                <em>
                    <input type="text" name="student_name"  id="student_name" >
                    <img src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/images/student_03.png"/>
                </em>
            </li>
            <li>
                <span>手机号码 <i>*</i></span>
                <em>
                    <input style="width: 98%;height: 0.7rem;" type="number" pattern="[0-9]*" name="" id="phone" />
                    <img src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/images/student_11.png"/>
                </em>
            </li>
            <li style="position: relative;">
                <span>验证码 <i>*</i></span>
                <em>
                    <input style="width: 60%;height: 0.7rem;" type="number" name="" id="yzm" pattern="[0-9]*" />
                    <img src="https://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/images/student_14.png"/>
                    <div class="huoqu">获取验证码</div>
                </em>
            </li>
        </ul>
    
        <input type="submit" value="提交信息并签字" class="dotm_btn1" style="position: fixed;bottom: 0;">

    </div>
</div>

<script>
  var source = '{$source}';
  $(function(){
   $('.huoqu').click(function() {
      var tel = $('#phone').val();
      if(!(/^1[3456789]\d{9}$/.test(tel))) {
        layer.open({
          content: '请输入正确的手机号码',
          skin: 'msg',
          time: 2 //2秒后自动关闭
        });
        return false;
      }
      $.ajax({
        type: 'get',
        url:"/api/activity/tel/tel/"+tel ,
        success: function(data){
          if(data.code == 0){
            $.ajax({
              type: 'post',
              url:"/api/sms/send" ,
              data:{mobile:tel,event:'recruitto'},
              success: function(data){
                if(data.code != 1){
                  layer.open({
                    content:data.msg ,
                    skin: 'msg',
                    time: 2 //2秒后自动关闭
                  });
                  return false
                }else{
                  var count = 120;
                  const countDown = setInterval(() => {
                    if (count === 0) {
                      $('.huoqu').text('重新发送').removeAttr('disabled');
                      $('.huoqu').css({
                        background: '#f3494c',
                        color: '#fff',
                      });
                      clearInterval(countDown);
                    } else {
                      $('.huoqu').attr('disabled', true);
                      $('.huoqu').css({
                        background: '#eee',
                        color: '#333',
                      });
                      $('.huoqu').text(count + '秒后可重新获取');
                    }
                    count--;
                  }, 1000);
                }
              }
            })
          }else{
            layer.open({
              content:'请先申请招募令',
              skin: 'msg',
              time: 2 //2秒后自动关闭
            });
            if(source){
               setTimeout(function () {
                       window.location.href="http://tmall.fc62.com/zhaomu.php?source="+source; 
                },1000);
              
            }
            return false
         
          }
        }
      });
    });

    $('.dotm_btn1').click(function(){
      var name = $('#student_name').val();
      var phone = $('#phone').val();
      var yzm = $('#yzm').val();
      if(name == ""||name == null){
        layer.open({
          content: '请填写乙方姓名',
          skin: 'msg',
          time: 2 //2秒后自动关闭
        });
         $("#name").focus();
        return false;
      }
      if(!(/^1[3456789]\d{9}$/.test(phone))) {
        layer.open({
          content: '请输入正确的手机号码',
          skin: 'msg',
          time: 2 //2秒后自动关闭
        });
           $("#phone").focus();
        return false;
      }
      if(yzm == ""||yzm == null){
        layer.open({
          content: '请填写验证码',
          skin: 'msg',
          time: 2 //2秒后自动关闭
        });
          $("#yzm").focus();
        return false;
      }
      
      
      var index = layer.open({type: 2});
      //验证验证码
      $.ajax({
        type: 'post',
        url:"/api/sms/check" ,
        data:{mobile:phone,captcha:yzm,event:'recruitto'},
        success: function(data){
          if(data.code == 0){
            layer.close(index);
            layer.open({
              content: data.msg,
              skin: 'msg',
              time: 2,
            });
            return false;
          }else{
            //添加禁止标签
            $('.dotm_btn1').attr("disabled","disabled");
            $.ajax({
              type: 'post',
              url:"/index/recruitto/generate/" ,
              data:{name:name,tel:phone},
              success: function(data){
                layer.close(index);
                 layer.open({
                    content: data.msg,
                    skin: 'msg',
                    time: 2, //2秒后自动关闭
                  });
                if(data.code == 0){
                  if(data.msg == '已经签订,正在跳转'){
                    window.location.href = data.url;
                  }
                  $('.dotm_btn1').attr("disabled","");
                  return false;
                }else{
                  window.location.href="/index/recruitto/handwriting/ids/"+data.data; 
                }
                

              }
            });
          }
        }
      });


    });
  });




</script>
</body>

</html>